package com.example.yingjiguanli_demo.Strategy.user;

import com.example.yingjiguanli_demo.pojo.LoginRequest;
import com.example.yingjiguanli_demo.pojo.Users;

/**
 * 密码正确策略
 * 检查密码是否正确
 */
public class PasswordCorrectStrategy implements AuthenticationStrategy {



    @Override
    public boolean authenticate(Users users, LoginRequest loginRequest) {
        return users.getPassword().equals(loginRequest.getPassword()); // 密码是否匹配
    }

    @Override
    public String getFailureMessage() {
        return "密码错误！";
    }
}

